/*
 * =====================================================================================
 *
 *       Filename:  void_pointer_test.c
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  2019年08月29日 17时02分17秒
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  YOUR NAME (), 
 *   Organization:  
 *
 * =====================================================================================
 */

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>

struct tlv {
    unsigned int type;
    unsigned int len;
    //void *value;
    char value[0];
};


int main()
{
    char buff[128] = {0};
    struct tlv *t = (struct tlv *)buff;
    t->type = 123;
    t->len = 4;
    char *value = (char *)(t->value);
    printf("t->value=%p, value=%p, buff+8=%p\n", t->value, value, buff+8);
    /*
     * char value[0]: t->value==value==buff+8
     * void *value;   t->value==value==NULL
     */
    return 0;
}

